<?php

namespace app\api\validate;

use think\Validate;

class Manystoreaapply extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name'  =>  'require|max:10',
        'mobile'  =>  'require|gt:0',
        'cat_id'  =>  'require|integer|gt:0',
        'id_card'  =>  'require|max:20',
        'id_card_positive_images'  =>  'require',
        'id_card_back_images'  =>  'require',
        'return_permit'  =>  'require|max:20',
        'return_permit_positive_images'  =>  'require',
        'return_permit_back_images'  =>  'require',
        'business_license_images'  =>  'require',
        'address'  =>  'require|max:50',
        'shop_name'  =>  'require|max:50',
        'avatar'  =>  'require',

    ];
    /**
     * 提示消息
     */
    protected $message = [
        'name.require'  =>  '請輸入法人姓名',
        'name.max'  =>  '法人姓名不得超過10個字符',
        'mobile.require'  =>  '請輸入手機號碼',
        'mobile.gt'  =>  '手機號碼必須為正整數',
        // 'mobile.max'  =>  '手機號碼不得超過10個字符',
        'cat_id.require'  =>  '請選擇經營類目',
        'cat_id.integer'  =>   '經營類目類型錯誤',
        'cat_id.gt'  =>   '經營類目類型錯誤',
        'id_card.require'  =>  '請輸入身份證號碼',
        'id_card.max'  =>  '身份證號碼不得超過20個字符',
        'id_card_positive_images.require'  =>  '請上傳身份證正面照',
        'id_card_back_images.require'  =>  '請上傳身份證反面照',
        'return_permit.require'  =>  '請輸入回鄉證號碼',
        'return_permit.max'  =>  '回鄉證號碼不得超過20個字符',
        'return_permit_positive_images.require'  =>  '請上傳回鄉證正面照',
        'return_permit_back_images.require'  =>  '請上傳回鄉證反面照',
        'business_license_images.require'  =>  '請上傳營業執照',
        'address.require'  =>  '請輸入公司地址',
        'address.max'  =>  '公司地址不得超過50個字符',
        'shop_name.require'  =>  '請輸入商家名稱',
        'shop_name.max'  =>  '商家名稱不得超過50個字符',
        'avatar.require'  =>  '請上傳商家頭像',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'apply'  => ['name','mobile','cat_id','id_card','id_card_positive_images','id_card_back_images','return_permit','return_permit_positive_images','return_permit_back_images','business_license_images','address','shop_name','avatar'],
        'task'  => ['id'],
    ];
    
}
